﻿Imports OpenLM.AstroNet.Common

Public Class Form1

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim JDtest As New OpenLM.AstroNet.AstroTime
		Dim TestDate As New DateTime

		'MessageBox.Show(JDtest.DateToJD(#10/4/1957 7:28:34 PM#).ToString)
		'MessageBox.Show(JDtest.DateToJD(#1/27/0333 12:00:00 PM#).ToString)
		'MessageBox.Show(JDtest.DateToJD(#10/4/1957 7:28:34 PM#).ToString)

		'MessageBox.Show(JDtest.JDToDate(2436116.3))
		'MessageBox.Show(JDtest.JDToDate(1507900.13))

		'MessageBox.Show(JDtest.EphemerisTime(#02/06/0555 06:00 AM B.C.#)
		'MessageBox.Show(JDtest.DeltaT(1977))

		'MessageBox.Show(JDtest.EasterDate(1978) & Environment.NewLine & JDtest.EasterDate(1979) & Environment.NewLine & JDtest.EasterDate(1954) & Environment.NewLine & JDtest.EasterDate(2000))
		'MessageBox.Show(JDtest.EasterDate(179) & Environment.NewLine & JDtest.EasterDate(711) & Environment.NewLine & JDtest.EasterDate(1243))

		MessageBox.Show(JDtest.SiderealTimeGreenwich(#11/13/1978 4:34:00 AM#, False).ToString("HH:mm:ss"))

	End Sub

	Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
		Dim OrbitalElements As PosSpeed
		Dim PolarPosition As PolarCoord
		Dim OrbitTest As New OpenLM.AstroNet.Coord
		Dim MiscFunction As New OpenLM.AstroNet.Common

		'OrbitalElements = OrbitTest.EllipticOrbitPosSpeed(2446612.5, 2446600.5, 2.772476, 0.2338349, 17.31081)
		'With OrbitalElements
		'	MessageBox.Show(.XPosition & Environment.NewLine & .YPosition & Environment.NewLine & .XSpeed & Environment.NewLine & .YSpeed)
		'End With

		'OrbitalElements = OrbitTest.ParabolicOrbitPosSpeed(2448630.5, 2448669.967, 4.87351)
		'With OrbitalElements
		'	MessageBox.Show(.XPosition & Environment.NewLine & .YPosition & Environment.NewLine & .XSpeed & Environment.NewLine & .YSpeed)
		'End With

		'OrbitalElements = OrbitTest.OrbitalToHeliocentric(309.89515, 34.80188, 172.64548, New PosSpeed(1.8503673603545681, 1.1680581295669481, 0, -0.005671987723205, 0.011469882574124, 0))
		'With OrbitalElements
		'	MessageBox.Show("X  : " & .XPosition & Environment.NewLine & "Y  : " & .YPosition & Environment.NewLine & "Z  : " & .ZPosition & Environment.NewLine & "vX : " & .XSpeed & Environment.NewLine & "vY : " & .YSpeed & Environment.NewLine & "vZ : " & .ZSpeed)
		'End With

		'OrbitalElements = OrbitTest.SunGeoPosition(2448743.5)
		'With OrbitalElements
		'	MessageBox.Show("X  : " & .XPosition & Environment.NewLine & "Y  : " & .YPosition & Environment.NewLine & "Z  : " & .ZPosition & Environment.NewLine & "vX : " & .XSpeed & Environment.NewLine & "vY : " & .YSpeed & Environment.NewLine & "vZ : " & .ZSpeed)
		'End With

		'OrbitalElements = OrbitTest.EclPrecession(EpochB1950, EpochJ2000, OrbitTest.OrbitalToHeliocentric(309.89515, 34.80188, 172.64548, New PosSpeed(1.8503673603545681, 1.1680581295669481, 0, -0.005671987723205, 0.011469882574124, 0)))
		'With OrbitalElements
		'	MessageBox.Show("X  : " & .XPosition & Environment.NewLine & "Y  : " & .YPosition & Environment.NewLine & "Z  : " & .ZPosition & Environment.NewLine & "vX : " & .XSpeed & Environment.NewLine & "vY : " & .YSpeed & Environment.NewLine & "vZ : " & .ZSpeed)
		'End With

		'OrbitalElements = OrbitTest.AberrationCorrection(New PosSpeed(-2.0050979669311859, 0.788305444249754, -0.382590945903829, -0.0062416233987670662, -0.0089516463067719557, 0.00668130352123005), New PosSpeed(-0.160368829272573, 1.0039599869866529, 0.000030338394289187359, -0.016712552619450139, -0.0026439394588505089, -0.00000012669225526689511), CoordType.Apparent)
		'With OrbitalElements
		'	MessageBox.Show("X  : " & .XPosition & Environment.NewLine & "Y  : " & .YPosition & Environment.NewLine & "Z  : " & .ZPosition & Environment.NewLine & "vX : " & .XSpeed & Environment.NewLine & "vY : " & .YSpeed & Environment.NewLine & "vZ : " & .ZSpeed)
		'End With

		'OrbitalElements = OrbitTest.EclicticToEquatorial(New PosSpeed(-2.1653645310861882, 1.792412098393896, -0.382700765124696, 0, 0, 0), EpochJ2000)
		'With OrbitalElements
		'	MessageBox.Show("X  : " & .XPosition & Environment.NewLine & "Y  : " & .YPosition & Environment.NewLine & "Z  : " & .ZPosition & Environment.NewLine & "vX : " & .XSpeed & Environment.NewLine & "vY : " & .YSpeed & Environment.NewLine & "vZ : " & .ZSpeed & Environment.NewLine & "Eps: " & OrbitTest.ObliquityEcliptic)
		'End With

		'OrbitalElements = OrbitTest.EqNutation(2443825.69, New PosSpeed(0.76204648880188131, 0.6049265025190923, 0.2622802453890567, 0, 0, 0), MiscFunction.DegreesToRadians(23.440288420318591))
		'With OrbitalElements
		'	MessageBox.Show("X  : " & .XPosition & Environment.NewLine & "Y  : " & .YPosition & Environment.NewLine & "Z  : " & .ZPosition & Environment.NewLine & "vX : " & .XSpeed & Environment.NewLine & "vY : " & .YSpeed & Environment.NewLine & "vZ : " & .ZSpeed)
		'End With

		PolarPosition = OrbitTest.CoordEquToPolar(New PosSpeed(-2.1653645310861882, 1.79673557003645, 0.36185949961501751, 0, 0, 0))
		With PolarPosition
			MessageBox.Show("Radius  : " & .Radius & Environment.NewLine & "Inclination  : " & .Inclination & Environment.NewLine & "Azimuth  : " & MiscFunction.DegreesToHours(.Azimuth))
		End With
	End Sub
End Class
